<template>
  <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
    <el-tab-pane label="充值" name="first">
      <recharge :tc-options="tcOptions" :user-name="userName" />
    </el-tab-pane>
    <el-tab-pane label="退款" name="second"> </el-tab-pane>
  </el-tabs>
</template>
<script>
import { listStaff } from '@/api/services/common'
import { mapState } from 'vuex'

export default {
  name: 'Deal',
  components: {
    recharge: () => import('./recharge'),
  },
  data() {
    return {
      activeName: 'first',
      tcOptions: [],
    }
  },
  computed: {
    ...mapState({
      clinicId: (state) => state.clinic.clinicId,
      userName: (state) => state.user.name,
    }),
  },
  mounted() {
    this.getListStaff()
  },
  methods: {
    async getListStaff() {
      const { data } = await listStaff({
        deptId: +this.clinicId,
        postname: 'TC',
      })

      this.tcOptions = data
    },
    handleClick(tab) {
      console.log(1)
    },
  },
}
</script>
